﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Member.aspx.cs" Inherits="WISD.CarFriend.Web.Admin.OA.MemberManage.Member" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>会员管理</title>
    <link href="../../Content/CSS/ClientCSS/qlsale.css" rel="stylesheet" type="text/css" />
    <link href="../../Content/CSS/ClientCSS/Table.css" rel="stylesheet" type="text/css" />
    <script src="/Admin/Scripts/ClientScripts/Page.js" type="text/javascript"></script>
    <script src="/Admin/Scripts/ClientScripts/CodyyForm.js" type="text/javascript"></script>
    <script src="/Admin/Scripts/ClientScripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script src="/Admin/Scripts/DatePicker/WdatePicker.js" type="text/javascript"></script>
</head>
<body>
    <div style="height: auto;">
        <table class="adduser" align="center" border="0" cellpadding="0" cellspacing="0"
            width="100%" bgcolor="#F2F7F5">
            <tbody>
                <tr>
                    <td colspan="5" class="bigTitle" height="40">
                        <strong>会员管理</strong>
                    </td>
                </tr>
                <tr>
                    <td class="sctitle" style="width: 81px;">
                        会员编号：
                    </td>
                    <td style="width: 162px;">
                        <input id="txtMemberID" class="xstxt" type="text" />
                    </td>
                    <td class="sctitle" style="width: 50px;"></td>
                    <td class="sctitle" style="width: 81px;">
                        会员姓名：
                    </td>
                    <td>
                        <input id="txtName" class="xstxt" type="text" />
                    </td>
                </tr>
                <tr>
                    <td class="sctitle" style="width: 81px;">
                        移动电话：
                    </td>
                    <td style="width: 162px;">
                        <input id="txtMobileTel" class="xstxt" type="text" />
                    </td>
                    <td class="sctitle" style="width: 50px;"></td>
                    <td class="sctitle" style="width: 81px;">
                        车牌号码：
                    </td>
                    <td>
                        <input id="txtVehicleNo" class="xstxt" type="text" />
                    </td>
                </tr>
                <tr>
                    <td class="sctitle" style="width: 81px;">
                        是否开卡：
                    </td>
                    <td colspan="4">
                        <select id="SelIsCard">
                            <option value="">---请选择---</option>
                            <option value="1">是</option>
                            <option value="0">否</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td colspan="5" class="fenline">
                        &nbsp;
                        <input value="搜索" class="twobtn" type="button" id="btnSearch" />&nbsp;&nbsp;
                        <input class="twobtn" value="新增" type="button" id="btnAdd" />&nbsp;
                    </td>
                </tr>
                <tr>
                    <td colspan="5">
                        <table rules="all" class="tableStyle">
                            <thead>
                                <tr>
                                    <th scope="col">
                                        会员编号
                                    </th>
                                    <th scope="col">
                                        姓名
                                    </th>
                                    <th scope="col">
                                        性别
                                    </th>
                                    <th scope="col">
                                        移动电话
                                    </th>
                                    <th scope="col">
                                        车牌号码
                                    </th>
                                    <th scope="col">
                                        车型
                                    </th>
                                    <th scope="col">
                                        是否开卡
                                    </th>
                                    <th scope="col">
                                        操作
                                    </th>
                                </tr>
                            </thead>
                            <tbody id="databody">
                            </tbody>
                            <tfoot id="footer" class="div_footer">
                            </tfoot>
                        </table>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
    <div id="registerdiv" class="registerdiv" style="width: 750px;">
        <table class="addTable" align="center" border="0" cellpadding="0" cellspacing="0"
            width="100%">
            <tbody>
                <tr class="topTitle">
                    <td colspan="4" style="margin-top: -3px;">
                        <ul>
                            <li class="leftli">添加会员</li>
                            <li class="rightli" onclick="$('#registerdiv').hide();">
                                <img alt="关闭" title="关闭" id="close" src="/Admin/Content/Images/tdClose_Hover.png" /></li>
                        </ul>
                    </td>
                </tr>
                <tr>
                    <td class="sctitle_four">
                        会员编号：
                    </td>
                    <td colspan="3">
                        <input id="txtMemberID1" name="MemberID" class="stxt" type="text" clear="yes" />
                    </td>
                </tr>
                <tr>
                    <td class="sctitle_four">
                        网站用户名：
                    </td>
                    <td>
                        <input id="txtWebUserName" name="WebUserName" class="stxt" type="text" reg="^[A-Za-z0-9_\-\u4e00-\u9fa5]+$"
                            needcheck="yes" tip="['网站用户名不能为空','只能为中英文','长度在1-50之间']" scope="1,50" clear="yes" />
                        <span></span>
                    </td>
                    <td class="sctitle_four">
                        用户密码：
                    </td>
                    <td>
                        <input id="txtWebPwd" name="WebPwd" class="stxt" type="password" reg="^[A-Za-z0-9_-]+$"
                            needcheck="yes" tip="['用户密码不能为空','只能为字母数字下划线','长度在1-50之间']" scope="1,50" clear="yes" />
                        <span></span>
                    </td>
                </tr>
                <tr>
                    <td class="sctitle_four">
                        姓名：
                    </td>
                    <td>
                        <input id="txtName1" name="Name" class="stxt" type="text" reg="([\u4e00-\u9fa5]+|[a-zA-Z]+)"
                            needcheck="yes" tip="['姓名不能为空','只能为中英文','长度在1-50之间']" scope="1,50" clear="yes" />
                        <span></span>
                    </td>
                    <td class="sctitle_four">
                        性别：
                    </td>
                    <td>
                        <select id="SelSex" name="Sex">
                            <option value="1">男</option>
                            <option value="0">女</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td class="sctitle_four">
                        生日：
                    </td>
                    <td>
                        <input id="txtBirthday" name="Birthday" onclick="WdatePicker()" class="stxt" type="text"
                            reg="^\d{4}(\-|\/|\.)\d{1,2}\1\d{1,2}$" needcheck="yes" tip="['','生日只能是日期']" clear="yes"
                            allownull="yes" />
                        <span></span>
                    </td>
                    <td class="sctitle_four">
                        移动电话：
                    </td>
                    <td>
                        <input id="txtMobileTel1" name="MobileTel" class="stxt" type="text" reg="^(13|14|15|18)[0-9]{9}$"
                            needcheck="yes" tip="['移动电话不能为空','移动电话格式不对']" clear="yes" />
                        <span></span>
                    </td>
                </tr>
                <tr>
                    <td class="sctitle_four">
                        QQ号码：
                    </td>
                    <td>
                        <input id="txtQQ" name="QQ" class="stxt" type="text" reg="^[1-9]*[1-9][0-9]*$" needcheck="yes"
                            tip="['','QQ格式不对']" clear="yes" allownull="yes" />
                        <span></span>
                    </td>
                    <td class="sctitle_four">
                        电子邮件：
                    </td>
                    <td>
                        <input id="txtEmail" name="Email" class="stxt" type="text" reg="^\w+((-w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$"
                            needcheck="yes" tip="['','电子邮件格式不对']" clear="yes" allownull="yes" />
                        <span></span>
                    </td>
                </tr>
                <tr>
                    <td class="sctitle_four">
                        身份证号：
                    </td>
                    <td>
                        <input id="txtIdentityCard" name="IdentityCard" class="stxt" type="text" reg="^\d{17}[\d|x]|\d{15}$"
                            needcheck="yes" tip="['','身份证号格式不对']" clear="yes" allownull="yes" />
                        <span></span>
                    </td>
                    <td class="sctitle_four">
                        所在区域：
                    </td>
                    <td>
                        <input id="txtAddress" name="Address" class="stxt" type="text" reg="[A-Za-z0-9_\-\u4e00-\u9fa5]+$"
                            needcheck="yes" tip="['所在区域不能为空','只能为中英文','长度在1-500之间']" scope="1,500" clear="yes" />
                        <span></span>
                    </td>
                </tr>
                <tr>
                    <td class="sctitle_four">
                        下次回访日期：
                    </td>
                    <td>
                        <input id="txtReturnVisitDate" name="ReturnVisitDate" onclick="WdatePicker()" class="stxt" type="text"
                            reg="^\d{4}(\-|\/|\.)\d{1,2}\1\d{1,2}$" needcheck="yes" tip="['','下次回访日期格式不对']" clear="yes"
                            allownull="yes" />
                        <span></span>
                    </td>
                    <td class="sctitle_four">
                        车牌号码：
                    </td>
                    <td>
                        <input id="txtVehicleNo1" name="VehicleNo" class="stxt" type="text" reg="^[\u4e00-\u9fa5]{1}[A-Z]{1}[A-Z_0-9]{5}$"
                            needcheck="yes" tip="['车牌号码不能为空','车牌号码规则：第一个必须是汉字，第二个必须是大写字母，后5个必须是大写字母或数字','长度在1-50之间']" scope="1,50" clear="yes" />
                        <span></span>
                    </td>
                </tr>
                <tr>
                    <td class="sctitle_four">
                        车 型：
                    </td>
                    <td>
                        <input id="txtVehicleStyle" name="VehicleStyle" class="stxt" type="text" reg="\S"
                            needcheck="yes" tip="['','格式不对']" clear="yes" allownull="yes" />
                        <span></span>
                    </td>
                    <td class="sctitle_four">
                        发动机号码：
                    </td>
                    <td>
                        <input id="txtEngineNo" name="EngineNo" class="stxt" type="text" reg="[\u4e00-\u9fa5a-zA-Z0-9]+"
                            needcheck="yes" tip="['','只能为中英文']"  clear="yes" allownull="yes" />
                        <span></span>
                    </td>
                </tr>
                <tr>
                    <td class="sctitle_four">
                        车架号码：
                    </td>
                    <td>
                        <input id="txtVehicleFrameNo" name="VehicleFrameNo" class="stxt" type="text" reg="[\u4e00-\u9fa5a-zA-Z0-9]+"
                            needcheck="yes" tip="['','格式不对']" clear="yes" allownull="yes" />
                        <span></span>
                    </td>
                    <td class="sctitle_four">
                        驾驶证号码：
                    </td>
                    <td>
                        <input id="txtDriveCardNo" name="DriveCardNo" class="stxt" type="text" reg="[\u4e00-\u9fa5a-zA-Z0-9]+"
                            needcheck="yes" tip="['','只能为中英文']" clear="yes" allownull="yes" />
                        <span></span>
                    </td>
                </tr>
                <tr>
                    <td class="sctitle_six">
                        驾驶证年审日期：
                    </td>
                    <td>
                        <input id="txtDriveCardAnnualReviewDate" name="DriveCardAnnualReviewDate" onclick="WdatePicker()" class="stxt" type="text"
                            reg="^\d{4}(\-|\/|\.)\d{1,2}\1\d{1,2}$" needcheck="yes" tip="['','驾驶证年审日期格式不对']" clear="yes"
                            allownull="yes" />
                        <span></span>
                    </td>
                    <td class="sctitle_four">
                        初次领证日期：
                    </td>
                    <td>
                        <input id="txtDriveCardGetDate" name="DriveCardGetDate" onclick="WdatePicker()" class="stxt" type="text"
                            reg="^\d{4}(\-|\/|\.)\d{1,2}\1\d{1,2}$" needcheck="yes" tip="['','初次领证日期格式不对']" clear="yes"
                            allownull="yes" />
                        <span></span>
                    </td>
                </tr>
                <tr>
                    <td class="sctitle_four">
                        行驶证号码：
                    </td>
                    <td>
                        <input id="txtRideCardNo" name="RideCardNo" class="stxt" type="text" reg="^[A-Za-z0-9_\-\u4e00-\u9fa5]+$"
                            needcheck="yes" tip="['','格式不对']" clear="yes" allownull="yes" />
                        <span></span>
                    </td>
                    <td class="sctitle_six">
                        行驶证年审日期：
                    </td>
                    <td>
                        <input id="txtRideCardAnnualReviewDate" name="RideCardAnnualReviewDate" onclick="WdatePicker()" class="stxt" type="text"
                            reg="^\d{4}(\-|\/|\.)\d{1,2}\1\d{1,2}$" needcheck="yes" tip="['','行驶证年审日期格式不对']" clear="yes"
                            allownull="yes" />
                        <span></span>
                    </td>
                </tr>
                <tr>
                    <td class="sctitle_four">
                        购车日期：
                    </td>
                    <td>
                        <input id="txtPurchaseDate" name="PurchaseDate" onclick="WdatePicker()" class="stxt" type="text"
                            reg="^\d{4}(\-|\/|\.)\d{1,2}\1\d{1,2}$" needcheck="yes" tip="['','购车日期格式不对']" clear="yes"
                            allownull="yes" />
                        <span></span>
                    </td>
                    <td class="sctitle_four">
                        下次保养日期：
                    </td>
                    <td>
                        <input id="txtNextMaintenanceDate" name="NextMaintenanceDate" onclick="WdatePicker()" class="stxt" type="text"
                            reg="^\d{4}(\-|\/|\.)\d{1,2}\1\d{1,2}$" needcheck="yes" tip="['','下次保养日期格式不对']" clear="yes"
                            allownull="yes" />
                        <span></span>
                    </td>
                </tr>
                <tr>
                    <td class="sctitle_six">
                        年检到期日期：
                    </td>
                    <td>
                        <input id="txtVehicleAnnualInspectionDate" name="VehicleAnnualInspectionDate" onclick="WdatePicker()" class="stxt" type="text"
                            reg="^\d{4}(\-|\/|\.)\d{1,2}\1\d{1,2}$" needcheck="yes" tip="['','年检到期日期格式不对']" clear="yes"
                            allownull="yes" />
                        <span></span>
                    </td>
                    <td class="sctitle_six">
                        保单号码：
                    </td>
                    <td>
                        <input id="txtInsuranceNo" name="InsuranceNo" class="stxt" type="text" reg="\w+"
                            needcheck="yes" tip="['','只能为数字字母下划线']" clear="yes" allownull="yes" />
                        <span></span>
                    </td>
                </tr>
                <tr>
                    <td class="sctitle_six">
                        保单到期日期：
                    </td>
                    <td>
                        <input id="txtInsuranceExpirationDate" name="InsuranceExpirationDate" onclick="WdatePicker()" class="stxt" type="text"
                            reg="^\d{4}(\-|\/|\.)\d{1,2}\1\d{1,2}$" needcheck="yes" tip="['','保单到期日期格式不对']" clear="yes"
                            allownull="yes" />
                        <span></span>
                    </td>
                    <td class="sctitle_four">
                        油耗：
                    </td>
                    <td>
                        <input id="txtOilConsumption" name="OilConsumption" class="stxt" type="text" reg="^\d*\.?\d+$"
                            needcheck="yes" tip="['','只能为数字']" clear="yes" allownull="yes" />
                        <span></span>
                    </td>
                </tr>
                <tr>
                    <td class="sctitle_six">
                        车辆已行驶公里：
                    </td>
                    <td>
                        <input id="txtDriveKilometers" name="DriveKilometers" class="stxt" type="text" reg="^\d*\.?\d+$"
                            needcheck="yes" tip="['','只能为数字']" clear="yes" allownull="yes" />
                        <span></span>
                    </td>
                    <td class="sctitle_four">
                        是否开卡：
                    </td>
                    <td>
                        <select id="SelIsCard1" name="IsCard">
                            <option value="0">否</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td colspan="4" style="height: 15px;">
                    </td>
                </tr>
                <tr>
                    <td colspan="4" align="center" style="text-align: center;">
                        <input value="修改" id="btnEdit" class="twobtn" type="button" />&nbsp;&nbsp;
                        <input value="保存" id="btnSave" class="twobtn" type="button" />&nbsp;&nbsp;
                        <input id="btnRest" class="twobtn" value="重置" type="button" />
                    </td>
                </tr>
                <tr>
                    <td colspan="4" style="height: 15px;">
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</body>
</html>
<script type="text/javascript">

    //赋值操作
    function EditEntity() {
        var rs = Page.Static.Rs[0];
        $("#txtMemberID1").val(rs["MemberID"]);
        $("#txtWebUserName").val(rs["WebUserName"]);
        $("#txtWebPwd").val(rs["WebPwd"]);
        $("#txtName1").val(rs["Name"]);
        $("#SelSex").val(rs["Sex"]);
        $("#txtBirthday").val(rs["Birthday"].split(" ")[0]);
        $("#txtMobileTel1").val(rs["MobileTel"]);
        $("#txtQQ").val(rs["QQ"]);
        $("#txtEmail").val(rs["Email"]);
        $("#txtIdentityCard").val(rs["IdentityCard"]);
        $("#txtAddress").val(rs["Address"]);
        $("#txtReturnVisitDate").val(rs["ReturnVisitDate"].split(" ")[0]);
        $("#txtVehicleNo1").val(rs["VehicleNo"]);
        $("#txtVehicleStyle").val(rs["VehicleStyle"]);
        $("#txtEngineNo").val(rs["EngineNo"]);
        $("#txtVehicleFrameNo").val(rs["VehicleFrameNo"]);
        $("#txtDriveCardNo").val(rs["DriveCardNo"]);
        $("#txtDriveCardAnnualReviewDate").val(rs["DriveCardAnnualReviewDate"].split(" ")[0]);
        $("#txtDriveCardGetDate").val(rs["DriveCardGetDate"].split(" ")[0]);
        $("#txtRideCardNo").val(rs["RideCardNo"].split(" ")[0]);
        $("#txtRideCardAnnualReviewDate").val(rs["RideCardAnnualReviewDate"].split(" ")[0]);
        $("#txtPurchaseDate").val(rs["PurchaseDate"].split(" ")[0]);
        $("#txtNextMaintenanceDate").val(rs["NextMaintenanceDate"].split(" ")[0]);
        $("#txtVehicleAnnualInspectionDate").val(rs["VehicleAnnualInspectionDate"].split(" ")[0]);
        $("#txtInsuranceNo").val(rs["InsuranceNo"].split(" ")[0]);
        $("#txtInsuranceExpirationDate").val(rs["InsuranceExpirationDate"].split(" ")[0]);
        $("#txtOilConsumption").val(rs["OilConsumption"]);
        $("#txtDriveKilometers").val(rs["DriveKilometers"]);
        $("#SelIsCard1").val(rs["IsCard"]);
    };

    //专门用来保存某个记录的详细消息
    var rs = {};

    $(function () {
        var MainPK = "";
        var Condition = "";
        var CurrentPage = 1;

        //失去焦点验证
        Form.Blur({ id: "registerdiv" });

        //添加修改记录
        var setEntity = function (obj) {
            var Result = Form.Validator({ id: "registerdiv" });
            if (Result) {
                var _$ = function (id) { return document.getElementById(id); };
                var data = {
                    Action: obj.Action
                      , MemberID: $.trim($("#txtMemberID1").val())
                      , WebUserName: $.trim($("#txtWebUserName").val())
                      , WebPwd: $.trim($("#txtWebPwd").val())
                      , Name: $.trim($("#txtName1").val())
                      , Sex: $.trim($("#SelSex").val())
                      , Birthday: $.trim($("#txtBirthday").val())
                      , MobileTel: $.trim($("#txtMobileTel1").val())
                      , QQ: $.trim($("#txtQQ").val())
                      , Email: $.trim($("#txtEmail").val())
                      , IdentityCard: $.trim($("#txtIdentityCard").val())
                      , Address: $.trim($("#txtAddress").val())
                      , ReturnVisitDate: $.trim($("#txtReturnVisitDate").val())
                      , VehicleNo: $.trim($("#txtVehicleNo1").val())
                      , VehicleStyle: $.trim($("#txtVehicleStyle").val())
                      , EngineNo: $.trim($("#txtEngineNo").val())
                      , VehicleFrameNo: $.trim($("#txtVehicleFrameNo").val())
                      , DriveCardNo: $.trim($("#txtDriveCardNo").val())
                      , DriveCardAnnualReviewDate: $.trim($("#txtDriveCardAnnualReviewDate").val())
                      , DriveCardGetDate: $.trim($("#txtDriveCardGetDate").val())
                      , RideCardNo: $.trim($("#txtRideCardNo").val())
                      , RideCardAnnualReviewDate: $.trim($("#txtRideCardAnnualReviewDate").val())
                      , PurchaseDate: $.trim($("#txtPurchaseDate").val())
                      , NextMaintenanceDate: $.trim($("#txtNextMaintenanceDate").val())
                      , VehicleAnnualInspectionDate: $.trim($("#txtVehicleAnnualInspectionDate").val())
                      , InsuranceNo: $.trim($("#txtInsuranceNo").val())
                      , InsuranceExpirationDate: $.trim($("#txtInsuranceExpirationDate").val())
                      , OilConsumption: $.trim($("#txtOilConsumption").val())
                      , DriveKilometers: $.trim($("#txtDriveKilometers").val())
                      , IsCard: $.trim($("#SelIsCard1").val())
                };
                if (obj.Action == "EditEntity") { data["Main"] = obj.Main; }
                $.post("/Admin/Control/Member.ashx", data, function (data) {
                    if (data.split(",")[0] === "Success") {
                        if (obj.Action == "AddEntity") {
                            alert("添加成功!");
                            Condition = GetCondition();
                            CurrentPage = Page.Static.CurrentPage;
                            InitPage();
                        }
                        else {
                            alert("修改成功!");
                            Condition = GetCondition();
                            CurrentPage = Page.Static.CurrentPage;
                            InitPage();
                        }
                    }
                    else {
                        obj.Action == "AddEntity" ? alert("添加失败！") : alert("修改失败！"); ;
                    }
                });
            }
        }

        //获取查询条件
        var GetCondition = function () {
            var MemberID = $("#txtMemberID").val() || "null"; //会员编号
            var Name = $("#txtName").val() || "null"; //会员姓名
            var MobileTel = $("#txtMobileTel").val() || "null"; //移动电话
            var VehicleNo = $("#txtVehicleNo").val() || "null"; //车牌号码
            var IsCard = $("#SelIsCard").val() || "null";  //是否开卡
            return MemberID + "@" + Name + "@" + MobileTel + "@" + VehicleNo + "@" + IsCard;
        };

        //加载数据
        var InitPage = function () {
            Page.GetData({ "Control": "/Admin/Control/Member.ashx", "Action": "Init", "first": true, "colspan": 50, "Condition": Condition, "CurrentPage": CurrentPage, "databody": "databody", "footer": "footer" });
        };

        //第一次加载数据
        Condition = GetCondition();
        InitPage();

        //重置表单
        var ResetForm = function () {
            $(".addTable").find("input[type='text'][clear='yes'],input[type='password'][clear='yes'],textarea[clear='yes']").val("");
            $(".addTable").find("input,textarea,select").attr("disabled", false);
        };

        //点击搜索按钮
        $("#btnSearch").click(function () {
            Condition = GetCondition();
            CurrentPage = 1;
            InitPage();
        });

        //点击新增按钮
        $("#btnAdd").click(function () {
            ResetForm();
            GetMemberId();
            $("#txtMemberID1").attr("disabled", true);
            $("#btnSave,#btnRest").show();
            $("#btnEdit").hide();
            $(".leftli").html("添加会员信息");
            Page.divCenter($("#registerdiv")[0]);
        });

        //点击保存按钮
        $("#btnSave").click(function () {
            setEntity({ "Action": "AddEntity" });
        });

        //点击重置按钮
        $("#btnRest").click(function () {
            ResetForm();
        });

        //点击修改按钮
        $("#btnEdit").click(function () {
            setEntity({ "Action": "EditEntity", "Main": MainPK });
        });

        //在Table中点击修改、删除 
        $("#databody").click(function (e) {
            var that = this;
            var e = e || window.event;
            var target = e.srcElement || e.target;
            if ($(target).is("a")) {
                var action = $(target).attr("action");
                var main = $(target).parent().parent().attr("main");
                MainPK = main;
                if (!action.localeCompare("edit")) {    //编辑
                    ResetForm();
                    $("#btnSave,#btnRest").hide();
                    $("#btnEdit").show();
                    $("#txtMemberID1").attr("disabled", true);
                    $(".leftli").html("修改会员信息");
                    var divobj = $("#registerdiv");
                    Page.divCenter(divobj[0]).GetOne({ "Main": main });
                }
                if (!action.localeCompare("delete")) {    //删除
                    if (confirm("是否确定删除该记录?")) {
                        Page.DeleteEntity({ "Main": main });
                    }
                }
                (! -[1, ]) ? e.cancelBubble = true : e.stopPropagation();
            }
        }).dblclick(function (e) {    //双击查看详细信息
            var that = this;
            var e = e || window.event;
            var target = e.srcElement || e.target;
            if ($(target.parentNode).is("tr")) {
                var main = $(target.parentNode).attr("main");
                ResetForm();
                $("#btnEdit,#btnSave,#btnRest").hide();
                $(".addTable").find("input,textarea,select").attr("disabled", true);
                $(".leftli").html("会员详细信息");
                var divobj = $("#registerdiv");
                Page.divCenter(divobj[0]).GetOne({ "Main": main });
                (! -[1, ]) ? e.cancelBubble = true : e.stopPropagation();
            }
        });

        //获取会员编号
        var GetMemberId = function () {
            $.post("/Admin/Control/Member.ashx", { Action: "GetMemberId" }, function (data) {
                $("#txtMemberID1").val(data);
            });
        };

    });
</script>
